Method and device for file backup and recovery

ABSTRACT

Embodiments of the present disclosure provide a method and device for file backup and recovery. The method for file backup comprises receiving a file to be backed up and metadata describing an attribute of the file. The method further includes storing the metadata into a cache. The method further includes storing the file into a storage device for data backup. The method further includes receiving, from the storage device, information that indicates a storage position of the file in the storage device. Besides, the method further includes storing the information into the cache at an address that is determined based on the metadata.

RELATED APPLICATIONS

This application claim priority from Chinese Patent Application NumberCN201710250225.6, filed on Apr. 17, 2017 at the State IntellectualProperty Office, China, titled “METHOD AND DEVICE FOR FILE BACKUP ANDRECOVERY” the contents of which is herein incorporated by reference inits entirety.

FIELD

Embodiments of the present disclosure generally relate to the field ofdata storage, and more specifically, to a method and system of filebackup and recovery.

BACKGROUND

A Network Attached Storage (NAS) device is typically configured as anode of the network in a local area network. As the NAS device isdirectly arranged in the local area network, a user is allowed todirectly access the data on the network. In this arrangement, the NASdevice may manage and process all data on the network in a centralizedmanner, thereby reducing a load of the application or enterprise serverand lowering the cost.

Upon receiving a large amount of data from the network, the networkattached storage device needs to perform backup processing on thereceived data, in order to ensure data safety. In a backup process, abackup management system is typically used to store data on the networkattached storage device to a backup storage system. In general, duringdata backup, all information of the data will be stored in the backupsystem; and if the backup data are to be recovered, it is required toretrieve the corresponding data in the backup system. Due to a greatnumber of comparison operations required during the retrieve in thebackup system and a relatively slow processing speed of the backupsystem, the recovery process of data is prolonged, and the cost forreceiving the backup data is increased accordingly.

SUMMARY

The purpose of the present disclosure is to provide a method for filebackup and recovery.

According to a first aspect of the present disclosure, there provides amethod for file backup. The method comprises receiving a file to bebacked up and metadata describing an attribute of the file; storing themetadata into a cache; storing the file into a storage device for databackup; receiving, from the storage device, information that indicates astorage position of the file in the storage device; and storing theinformation into the cache at an address that is determined based on themetadata.

In some embodiments, the metadata includes: indication information of afile type; and indication information of a storage position of themetadata.

In some embodiments, the address is determined based on the metadata by:determining the address based on the indication information of the filetype and the indication information of the storage position.

In some embodiments, information of the storage position includesposition information, type information, a storage unit ID and offsetinformation of the file in the storage device.

According to a second aspect of the present disclosure, there provides amethod for file recovery. The method comprises receiving data forrecovering a file; determining, based on the received data, metadatadescribing an attribute of the file in a cache; determining, based onthe metadata, information that indicates a storage position of the filein a storage device in the cache; obtaining the file from the storagedevice based on the storage position; and transmitting the file toimplement the file recovery.

In some embodiments, the data for recovering the file includes: theindication information of the storage position of the metadata.

According to a third aspect of the present disclosure, there provides anelectronic device. The electronic device comprises: at least oneprocessor; and a memory coupled to the at least one processor and havinginstructions stored thereon which, when executed by the at least oneprocessor, cause the device to perform acts including: receiving a fileto be backed up and metadata describing an attribute of the file;storing the metadata into the cache; storing the file into a storagedevice for data backup; receiving, from the storage device, informationthat indicates a storage position of the file in the storage device; andstoring the information into the cache at an address that is determinedbased on the metadata.

According to a fourth aspect of the present disclosure. The electronicdevice comprises: at least one processor; and a memory coupled to the atleast one processor and having instructions stored thereon which, whenexecuted by the at least one processor, cause the device to perform actsincluding: receiving data for recovering a file; determining, based onthe received data, metadata describing an attribute of the file in thecache; determining, based on the metadata, information that indicates astorage position of the file in a storage device in the cache; obtainingthe file from the storage device based on the storage position; andtransmitting the file to implement file recovery.

According to a fifth aspect, there provides a computer program product,the computer program product being tangibly stored on a non-volatilecomputer readable medium and including machine executable instructionswhich, when executed, cause the machine to execute steps of the methodaccording to the first aspect and the second aspect of the presentdisclosure.

It should be appreciated that this Summary is not intended to identifykey features or essential features of the claimed subject matter, nor isit intended to be used to limit the scope of the claimed subject matter.Other features of the present disclosure will be made apparent by thefollowing description.

BRIEF DESCRIPTION OF THE DRAWINGS

Through the following detailed description of the example embodiments ofthe present disclosure with reference to the accompanying drawings, theabove and other objectives, features, and advantages of exampleembodiments of the present disclosure will become more apparent,wherein, in the example embodiments of the present disclosure, identicalreference signs typically represent identical components.

FIG. 1 shows an architecture diagram of a storage system 100 accordingto embodiments of the present disclosure;

FIG. 2 shows a schematic diagram of a mapping relation 200 of dataaccording to embodiments of the present disclosure;

FIG. 3 illustrates a flow chart of a method 300 for file backupaccording to embodiments of the present disclosure;

FIG. 4 illustrates a flow chart of a method 400 for file recoveryaccording to embodiments of the present disclosure;

FIG. 5 illustrates a block diagram of a device 500 for file backupaccording to embodiments of the present disclosure;

FIG. 6 illustrates a block diagram of a device 600 for file recoveryaccording to embodiments of the present disclosure; and

FIG. 7 shows a schematic block diagram of an example device 700 adaptedto implement embodiments of the present disclosure.

Throughout the drawings, the same or corresponding reference signs referto the same or corresponding elements.

DETAILED DESCRIPTION OF EMBODIMENTS

Principles of example embodiments disclosed herein will now be describedwith reference to some example embodiments. It should be appreciatedthat description of those embodiments is merely to provide explanationand enable those skilled in the art to better understand and furtherimplement example embodiments disclosed herein and is not intended forlimiting the scope disclosed herein in any manner. The content of thepresent disclosure described herein may be implemented in variousmanners, besides the one described below.

As used herein, the term “includes” and its variants are to beunderstood as open-ended terms, which mean “includes, but is not limitedto.” The term “based on” can be understood as “based at least in parton.” The term “one embodiment” can be understood as “at least oneembodiment.” The term “another one embodiment” is to be read as “atleast one another embodiment.”

A network attached storage (NAS) device is typically used to store dataon the network. The data in the NAS device is typically backed up to abackup memory via a file backup system when the data therein are beingbacked up, and the backup data includes a file, a directory file, anaccess control list (ACL), or the like. Since the data are directlybacked up to a storage device, it is often required to search thedirectory in the backup memory during data restoration, and the data areobtained by comparison. As there is a great amount of data within thebackup memory and its running speed is relatively slow, the speed fordata backup and recovery is decelerated and the use cost thereof isincreased accordingly.

In order to at least solve the above problem and other potentialproblems, embodiments of the present disclosure provide a solution forfile backup and recovery. In this solution, the efficiency for databackup and recovery is improved by providing a cache within the filebackup system.

FIG. 1 shows an architecture diagram of a storage system 100 accordingto embodiments of the present disclosure. The storage system 100includes a data storage device 104. In an example, the data storagedevice 104 may be a NAS device. The NAS device 104 may be connected to anetwork and receives a large amount of data from the network. Thestorage system 100 may further include a file backup system 102 and abackup memory 106. In the example, the file backup system is a filebackup system for backing up data to be stored. In order to ensure datasafety in the storage device, the file backup system 102 backs up thedata on the storage device 104 to the backup memory 106. Alternativelyor in addition, the data storage device may be other data storagedevices.

The storage device 104 is a device for storing data, and it is requiredto back up data out of the need of data safety. The storage device 104may be a NAS device, a direct-attached storage (DAS) device, a storagearea network (SAN) device and other devices for storing and backing updata.

The backup memory 106 is a storage device for storing a large amount ofdata. The storage device may include various volatile and/or nonvolatiledata storage media. The example of the storage medium may include, butis not limited to a disk, an optical disk, a hard disk, a solid statedisk (SSD), and a cache.

In order to implement rapid access to the data in the backup memory 112,a cache 112 is arranged in the file backup system, and the cache 112stores key data for data backup, to achieve rapid backup of data. Thefile backup system 102 further includes a memory 108 and a controller110.

In this example, the data storage device 110 in FIG. 1 is a NAS devicewhich transmits data to the file backup system 112 via a network datamanagement protocol (NDMP). The transmitted data includes the file to bebacked up and metadata describing attributes of the file, and themetadata include one or more of the following item: a file type, name,size, route, index node value, etc., of the file stored in the NASdevice. Alternatively or in addition, the index node value is indicationinformation of a storage position of the metadata of the file stored inthe NAS. In one example, the indication information may be addressinformation. In another example, the indication information is a valuededicated to an identifier node allocated in the NAS device, forexample, if the index node information is stored in a manner similar toan array, the node value is the position in the array. The process offile backup implemented through the cache will be described below,referring to FIG. 2.

FIG. 2 shows a diagram of a mapping relation of data according toembodiments of the present disclosure. After receiving the data to bebacked up from the NAS device, the file backup system 102 acquires theindication information of the file type and the index node (inode) valuefrom the data. The indication information of the file type and the inodevalue form a data 201 to be stored in the cache. When backup datainclude a great number of files, multiple data 201, 202, 203, . . . ,are formed, and the formed data are stored in the cache. In one example,the multiple generated data may be stored in a form of array, and inother examples, these generated data may be stored in other appropriatemanners. Alternatively or in addition, the formed data may be stored ina specified storage space.

Two portions of data 201, 202, 203 . . . form two mapping addresses. Inone example, the data obtained from the indication information of thefile type acts as a first address mapped to a corresponding tree, and ifthe type is a file, the indication information is mapped to a storageaddress of a root node of the file tree. Similarly, if the file type isa directory or access control list, the indication information of thefile type is mapped to a storage address of the root node of thedirectory tree or access control list tree. Additionally oralternatively, the type of the file may be any type of various filesused in the computer.

Take the data 201 as an example, after mapping to the root node of thefile tree based on the indication information of the file type, the data201 is mapped to the leaf node of the file tree based on the index nodevalue, i.e., after searching the address of the file tree root node, theaddress of the leaf node of the file tree is searched based on the indexnode value. In one example, the index node may be denoted by 8hexadecimal numbers. The 8 numbers are divided into multiple sections torepresent multiple layers of the tree. For example, the three layers ofthe tree formed by the 8 numbers are divided in a form of digits 2, 3,3. Referring to FIG. 2, the index node value in the data 201 are“0X02001001”, the corresponding tree thereof is divided into threelayers, and the layers respectively correspond to 2 digits, 3 digits and3 digits of the index node value. For example, the data 201 are dividedinto “02”, 001” and “001”, and the leaf node 001 of the file tree isfound in this way, as shown in FIG. 2. In another example, the value ofthe index node may be set as a value having any digits. Likewise, thedata 202 and 203 may be mapped to corresponding leaf nodes of the treein this way, as well.

As described above, based on the received indication information of thefile type and the index node value, an address, namely the leaf node ofthe tree, is determined in a cache. The information stored at theaddress is the information described below. The information of themetadata is backed up in the cache, and the data to be backed up,including the file, are transmitted to the backup memory 106. Uponstoring the backup file in the backup memory 106, information of thestorage position of the file will be generated in the backup memory. Inone example, the information of the storage position of the fileincludes, but is not limited to, position information, type information,a storage unit ID and offset information of the file in the backupmemory. After the backup memory 106 generates the information of thestorage position of the file, the backup memory 106 transmits theinformation to the file backup system 112. Then the information isstored into the file backup system 112, and the storage address of theinformation is the address determined, as described above, in the cacheby the indication information of the file type and the index node value.Therefore, by storing the data formed by the indication information ofthe file type and the index node value in the cache, as well as theinformation of the storage positions of the files corresponding thereto,the target backup data may be obtained quickly by utilizing the mappingrelation stored in the cache when the backup file is searched, so as toimplement data recovery. The backup process of the data will bedescribed below with reference to FIG. 3. The recovery process of datawill be detailed with reference to FIG. 4.

FIG. 3 shows a flowchart of a method 300 for file backup according toembodiments of the present disclosure. In the method of file backupdisclosed in FIG. 3, at block 302, the file to be backed up and themetadata describing an attribute of the file are received. In FIG. 1,after the data storage device 104 obtains and stores the data, the datastorage device 104 transmits the data to the file backup file 102 fordata safety. In one example, the data storage device 104 transmits thedata to the file backup system via the NDMP. The data transmitted basedon the protocol includes the file and the metadata of the file. In oneexample, the metadata of the file at least include the indicationinformation of the file type and the index node value. The index nodevalue is indication information that indicates the storage position ofthe metadata of the file in the data storage device 104.

In a block 304, the metadata are stored into the cache. A cache 112 isarranged in the file backup system 102 in FIG. 1. Upon receiving themetadata, the file backup system 102 stores the metadata into the cache.Because the access speed of the cache is faster than the conventionalstorage device, the metadata are processed by the cache, such that thespeed of process data is increased.

At block 306, the file is stored into a storage device for data backup.In FIG. 1, the data in the data storage device 104 are controlled by thefile backup system 102 to back up the data to the backup memory 106.When the data to be backed up are stored into the backup memory 106,related information of the storage position of the stored file isgenerated. The information includes, but is limited to, the positioninformation, type information, storage unit ID and offset information ofthe file stored in the backup memory.

At block 308, information that indicates the storage position of thefile in the storage device is received from the storage device. In FIG.1, the backup memory 106 transmits the information of storage positionof the file, as stated in the foregoing, to the file backup system 102.

At block 310, the information is stored into the cache at an addressthat is determined based on the metadata. In FIG. 1, upon receiving theabove mentioned information, the file backup system 102 stores theinformation of the storage position in the cache. The storage address ofthe storage position is determined based on the indication informationof file type in the metadata and the indication information of thestorage position of the metadata in the storage device 104. Determiningthe address has been discussed with reference to FIG. 2

FIG. 4 illustrates a flowchart of a method 400 for file backup accordingto embodiments of the present disclosure. Referring to FIGS. 2 and 3,the file backup system will store in its cache the address informationof the file stored in the backup memory 106, after the data is backedup. Accordingly, the backup data to be recovered may be found quicklyusing the cache of the file backup system 102. At block 402, data forrecovering file are received. As shown in FIG. 1, if a part of dataneeds recovering in the data storage device 104, a request should betransmitted to the file backup system 102 to recover the duplicateddata. In one example, the request at least includes the indicationinformation which indicates the storage position of the metadata of thefile in the data storage device 104, and the indication information maybe denoted in a form of the index node value.

At block 404, the metadata describing an attribute of the file aredetermined in the cache based on the received data. In FIG. 2, when thefile is being backed up, the metadata are stored in the cache. In oneexample, the metadata at least include the indication information of thefile type and the index node value. The metadata may be stored into thecache with a certain data structure. Consequently, when the index nodevalue is received, the metadata corresponding to the index node valuemay be determined. In another example, the data formed by the index nodevalue and the indication information of the file type may be determinedbased on the index node value.

At block 406, the storage address for the information of the storageposition is determined based on the metadata. The information of thestorage position is information of the storage position of the file inthe storage device. In view of the depiction on FIG. 2, based on thedata, a first address, namely the root node of the file type tree, isdetermined by the indication information of the file type. Then, acorresponding leaf node, namely a second address, is searched based onthe index node value. Referring to the depiction on FIG. 2, informationof the storage position of the file in the backup memory 106 is storedat the address determined by the metadata.

At block 408, the file is obtained from the storage device based on thestorage position. As the address of the file in the backup memory 106 isobtained, the file to be recovered can be searched quickly based on theaddress. In a block 410, the file is transmitted to implement the filerecovery.

FIG. 5 illustrates a block diagram of an apparatus 500 for file backupaccording to embodiments of the present disclosure. The apparatus 500may include a first receive module 510, which is configured to receive afile to be backed up and metadata describing attributes of the file. Theapparatus 500 may further include a metadata storage module 520, whichis configured to store metadata to the cache. The apparatus 500 mayfurther comprise a file storage module 530, which is configured to storethe file to the storage device for data backup. The apparatus 500 mayfurther include a second receive module 540, which is configured toreceive information of a storage position of the file in the storagedevice. Besides, the apparatus 500 may include an information storagemodule 550, which is configured to store information in the cache at anaddress which is determined based on the metadata.

FIG. 6 illustrates a block diagram of an apparatus 600 for file backupaccording to embodiments of the present disclosure. The apparatus 600may include a third receive module 610 configured to receive data forfile recovery. The apparatus 600 may also include a metadata determiningmodule 620 configured to determine in a cache metadata describingattributes of the file based on the received data. The apparatus 600 mayfurther include an information determining module 630 configured todetermine information in the cache which indicates a storage position ofthe file in the storage device based on the metadata. The apparatus 600may also include a file module 640 configured to obtain the file fromthe storage device based on the storage position. Besides, the apparatus600 may include a transmit module 650 configured to transmit the file toimplement file recovery.

For clarity, some optional modules of the apparatus 500 and/or 600 arenot shown in FIG. 5 and/or FIG. 6. However, it is to be understood thatall features as described with reference to FIGS. 1-4 may be applicableto the apparatus 500 and/or 600. Moreover, each module of the apparatus500 and/or 600 may be hardware module, or may be software module. Forexample, in some embodiments, the apparatus 500 and/or 600 may be partlyor entirely implemented using software and/or firmware, and for example,may be implemented as a computer program product included on a computerreadable medium. Alternatively or in addition, the apparatus 500 and/or600 may be partly or entirely implemented based on hardware, such as anIntegrated Circuit (IC), Application-specific Integrated Circuit (ASIC),System-on-a-chip systems (SOC), Field Programmable Gate of Arrays(FPGA), or the like. The scope of the present disclosure is not limitedin this aspect.

FIG. 7 shows a schematic block diagram of an example device 700 adaptedto implement embodiments of the present disclosure. For example, any oneof 102, 104 and 106 as shown in FIG. 1 may be implemented by the device700. As shown therein, the device 700 comprises a central processingunit (CPU) 701 that may perform various appropriate actions andprocessing based on computer program instructions stored in a read-onlymemory (ROM) 702 or computer program instructions loaded from a storagesection 708 to a random access memory (RAM) 703. In the RAM 703, variousprograms and data needed for operations of the device 700 are furtherstored. The CPU 701, ROM 702 and RAM 703 are connected to each other viaa bus 704. An input/output (I/O) interface 705 is also connected to thebus 704.

The following components in the device 700 are connected to the I/Ointerface 705: an input unit 706, such as a keyboard, a mouse and thelike; an output unit 707, such as various kinds of displays and aloudspeaker, etc.; a memory unit 708, such as a magnetic disk, anoptical disk, and etc.; a communication unit 709, such as a networkcard, a modem, and a wireless communication transceiver, etc. Thecommunication unit 709 allows the device 700 to exchangeinformation/data with other devices through a computer network such asthe Internet and/or various kinds of telecommunications networks.

Various processes and processing described above, e.g., the method 300or 400, may be executed by the processing unit 701. For example, in someembodiments, the method 300 may be implemented as a computer softwareprogram that is tangibly embodied on a machine readable medium, e.g.,the storage unit 708. In some embodiments, part or all of the computerprograms may be loaded and/or mounted onto the device 700 via ROM 702and/or communication unit 709. When the computer program is loaded tothe RAM 703 and executed by the CPU 701, one or more acts of the method300 or 400 as described above may be executed.

The present disclosure may be a method, a device, a system, and/or acomputer program product. The computer program product may include acomputer readable storage medium (or media) having computer readableprogram instructions thereon for performing aspects of the presentdisclosure.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present disclosure may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the scenario involvingthe remote computer, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, the electronic circuitry can bepersonalize customized by utilizing state information of the computerreadable program instructions, for example, programmable logiccircuitry, field-programmable gate arrays (FPGA), or programmable logicarrays (PLA). The electronic circuitry may execute the computer readableprogram instructions, in order to perform aspects of the presentdisclosure.

Aspects of the present disclosure are described herein with reference toflowchart illustrations and/or block diagrams of methods, device(systems), and computer program products according to embodiments of thedisclosure. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can enablea computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture, which includes instructions implementing aspectsof the function/act specified in block or blocks of the flowchart and/orblock diagram.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable data processing apparatus or other device to producea computer implemented process, such that the instructions which executeon the computer, other programmable data processing apparatus, or otherdevice implement the functions/acts specified in block or blocks of theflowchart and/or block diagram.

The flowchart and block diagrams illustrate the architecture,functionality, and operation of possible implementations of systems,methods and computer program products according to various embodimentsof the present disclosure. In this regard, each block in the flowchartor block diagrams may represent a module, snippet, or portion ofinstruction, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur in adifferent order than noted in the figures. For example, two blocks shownin succession may, in fact, be executed substantially concurrently, orthe blocks may sometimes be executed in the reversed order, dependingupon the functionality involved. It will also be noted that each blockof the block diagrams and/or flowchart illustration, and combinations ofblocks in the block diagrams and/or flowchart illustration, can beimplemented by special purpose hardware-based systems that perform thespecified functions or acts, or combinations of special purpose hardwareand computer instructions.

The descriptions of the various embodiments of the present disclosurehave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies in the marketplace, or to enable others ofordinary skilled in the art to understand the embodiments disclosedherein.

We claim:
 1. A method for file backup, comprising: receiving, at a filebackup system from a data storage device, a file to be backed up andmetadata describing attributes of the file, the attributes of the fileincluding a type of the file and a storage position of the metadata inthe data storage device; storing the metadata into a cache of the filebackup system; storing the file into a backup memory; receiving, at thefile backup system from the backup memory, information that indicates astorage position of the file in the backup memory; determining anaddress of the cache of the file backup system based on the type of thefile and the storage position of the metadata in the data storagedevice, the storage position of the metadata in the data storage devicebeing indicated by an index node value; mapping the type of the file toa storage address of a root node of a corresponding tree in the cache ofthe file backup system; and mapping the metadata to a leaf node of thecorresponding tree based on the index node value; and storing, in thecache of the file backup system at the determined address, theinformation that indicates the storage position of the file in thebackup memory.
 2. The method according to claim 1, wherein theinformation of the storage position of the file includes positioninformation, type information, a storage unit ID, and offset informationof the file in the backup memory.
 3. A method for file recovery,comprising: receiving, at a file backup system from a data storagedevice, data for recovering a file; determining, based on the receiveddata, metadata describing attributes of the file, the attributes of thefile including a type of the file and a storage position of the metadatain the data storage device; determining an address of a cache of thefile backup system based on the type of the file and the storageposition of the metadata in the data storage device, the storageposition of the metadata in the data storage device being indicated byan index node value, the determined address specifying a location of thecache; mapping the type of the file to a storage address of a root nodeof a corresponding tree in the cache of the file backup system; andmapping the metadata to a leaf node of the corresponding tree based onthe index node value; obtaining, from the location of the cachespecified by the determined address, information that indicates astorage position of the file in a backup memory; obtaining the file fromthe backup memory based on the storage position of the file; andtransmitting the file to implement the file recovery.
 4. The methodaccording to claim 3, wherein the data for recovering the file includesthe storage position of the metadata.
 5. The method according to claim3, wherein the information of the storage position of the file includesposition information, type information, a storage unit ID, and offsetinformation of the file in the backup memory.
 6. An electronic device,comprising: a cache; at least one processor; and a memory coupled to theat least one processor and having instructions stored thereon which,when executed by the at least one processor, cause the device to performacts including: receiving, from a data storage device, a file to bebacked up and metadata describing attributes of the file, the attributesof the file including a type of the file and a storage position of themetadata in the data storage device; storing the metadata into thecache; storing the file into a backup memory; receiving, from the backupmemory, information that indicates a storage position of the file in thebackup memory; determining an address of the cache based on the type ofthe file and the storage position of the metadata in the data storagedevice, the storage position of the metadata in the data storage devicebeing indicated by an index node value; mapping the type of the file toa storage address of a root node of a corresponding tree in the cache ofthe file backup system; and mapping the metadata to a leaf node of thecorresponding tree based on the index node value; and storing, in thecache at the determined address, the information that indicates thestorage position of the file in the backup memory.
 7. The electronicdevice according to claim 6, wherein the information of the storageposition of the file includes position information, type information, astorage unit ID, and offset information of the file in the backupmemory.